/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jhh09wxu.globalgadgets.ejb.session;

import java.util.List;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Ranga
 */
@Stateless
@Remote(LoginSession.class)
public class LoginSessionBean implements LoginSession, java.io.Serializable {

    @PersistenceContext
    private EntityManager entityManager;
    private static final long serialVersionUID = 1;

    
    public List<String> findPassword(String nickname) {
        List <String> password =null;
        Query q = this.entityManager.createQuery("SELECT c.password FROM Customer c WHERE c.nickname='" + nickname + "'");
        password = ((List) q.getResultList());
        return password;

    }
}
